# Maintainer: Laurent Carlier <lordheavym@gmail.com>
# Contributor : sebikul <sebikul@gmail.com>

pkgbase=gambas3
pkgname=('gambas3-gb-args'
         'gambas3-gb-cairo' 'gambas3-gb-chart' 'gambas3-gb-clipper' 'gambas3-gb-complex' 'gambas3-gb-compress' 'gambas3-gb-crypt'
         'gambas3-gb-dbus' 'gambas3-gb-data'
         'gambas3-gb-db-form' 'gambas3-gb-db-mysql' 'gambas3-gb-db-odbc' 'gambas3-gb-db-postgresql' 'gambas3-gb-db-sqlite3' 'gambas3-gb-db'
         'gambas3-gb-desktop-gnome' 'gambas3-gb-desktop-x11' 'gambas3-gb-desktop'
         'gambas3-gb-eval-highlight'
         'gambas3-gb-form-dialog' 'gambas3-gb-form-mdi' 'gambas3-gb-form-terminal' 'gambas3-gb-form-stock' 'gambas3-gb-form-editor' 'gambas3-gb-form-htmlview' 'gambas3-gb-form'
         'gambas3-gb-gmp' 'gambas3-gb-gsl' 'gambas3-gb-gtk3-opengl' 'gambas3-gb-gtk3'
         'gambas3-gb-hash' 'gambas3-gb-httpd'
         'gambas3-gb-image-effect' 'gambas3-gb-image-imlib' 'gambas3-gb-image-io' 'gambas3-gb-image' 'gambas3-gb-inotify'
         'gambas3-gb-libxml' 'gambas3-gb-logging'
         'gambas3-gb-map' 'gambas3-gb-markdown' 'gambas3-gb-media-form' 'gambas3-gb-media' 'gambas3-gb-memcached' 'gambas3-gb-mime' 'gambas3-gb-mysql'
         'gambas3-gb-ncurses' 'gambas3-gb-net-curl' 'gambas3-gb-net-pop3' 'gambas3-gb-net-smtp' 'gambas3-gb-net'
         'gambas3-gb-openal' 'gambas3-gb-opengl-glu' 'gambas3-gb-opengl-glsl' 'gambas3-gb-opengl-sge' 'gambas3-gb-opengl' 'gambas3-gb-option'
         'gambas3-gb-pcre' 'gambas3-gb-poppler'
         'gambas3-gb-qt5-opengl' 'gambas3-gb-qt5'
         'gambas3-gb-openssl'
         'gambas3-gb-report'
         'gambas3-gb-scanner' 'gambas3-gb-sdl2-audio' 'gambas3-gb-sdl2' 'gambas3-gb-sdl-sound' 'gambas3-gb-sdl' 'gambas3-gb-settings' 'gambas3-gb-signal'
         'gambas3-gb-term'
         'gambas3-gb-util-web' 'gambas3-gb-util'
         'gambas3-gb-v4l' 'gambas3-gb-vb'
         'gambas3-gb-xml-html' 'gambas3-gb-xml-rpc' 'gambas3-gb-xml-xslt' 'gambas3-gb-xml'
         'gambas3-gb-web-feed' 'gambas3-gb-web-form' 'gambas3-gb-web-gui' 'gambas3-gb-web'
         'gambas3-runtime' 'gambas3-dev-tools' 'gambas3-ide' 'gambas3-script')
pkgver=3.18.2
pkgrel=1
pkgdesc="A free development environment based on a Basic interpreter."
arch=('loong64' 'x86_64')
url="http://gambas.sourceforge.net/"
license=('GPL2')
groups=('gambas3')
makedepends=('intltool' 'postgresql' 'libffi' 'bzip2' 'glib2' 'v4l-utils'
         'zlib' 'mesa' 'glew' 'xdg-utils' 'imlib2' 'gdk-pixbuf2' 'gtk3' 'webkit2gtk'
         'postgresql-libs' 'mariadb-libs' 'unixodbc' 'sqlite' 'librsvg'
         'curl' 'poppler-glib' 'sdl_mixer' 'sdl_ttf' 'sdl2' 'sdl2_mixer' 'sdl2_image' 'sdl2_ttf' 'libxtst'
         'pcre2' 'qt5-webengine' 'qt5-x11extras' 'qt5-svg' 'libxcursor' 'libsm' 'dbus' 'libxml2'
         'libxslt' 'libgnome-keyring' 'gsl' 'gst-plugins-base-libs' 'alure' 'ncurses'
         'gmime3' 'libxcrypt')
options=('!emptydirs' 'libtool')
source=("https://gitlab.com/gambas/gambas/-/archive/${pkgver}/gambas-${pkgver}.tar.bz2")
sha512sums=('5002d7be1996ea85dadcd0db91802825d892ee92fed9dba72f60fdb37855c665e3587249584241c3305fbaf0769094193b947c610bca1780168384d18ae3678a')

prepare() {
  cd ${srcdir}/gambas-${pkgver}

  ./reconf-all
}

build() {
  cd ${srcdir}/gambas-${pkgver}

  GAMBAS_CONFIG_FAILURE=1 ./configure --prefix=/usr \
    --disable-sqlite2 \
    --disable-qt4  \
    --disable-gtk \
    --disable-pdf \
    --disable-qt5webkit

  make bindir=${pkgdir}/usr/bin

  mkdir -p ${srcdir}/fakeinstall
  make -j1 XDG_UTILS='' DESTDIR=${srcdir}/fakeinstall install
}

_install() {
  local src f dir
  for src; do
    f="${src#fakeinstall/}"
    dir="${pkgdir}/${f%/*}"
    install -m755 -d "${dir}"
    mv -v "${src}" "${dir}/"
  done
}

package_gambas3-gb-args() {
  depends=('gambas3-runtime')
  pkgdesc="Command-line options analyzer component"

  _install fakeinstall/usr/lib/gambas3/gb.args.*
  _install fakeinstall/usr/share/gambas3/info/gb.args.*
}

package_gambas3-gb-cairo() {
  depends=('gambas3-runtime' 'cairo')
  pkgdesc="Cairo component"

  _install fakeinstall/usr/lib/gambas3/gb.cairo.* ${pkgdir}/usr/lib/gambas3/
  _install fakeinstall/usr/share/gambas3/info/gb.cairo.* ${pkgdir}/usr/share/gambas3/info/
}

package_gambas3-gb-chart() {
  depends=('gambas3-gb-form')
  pkgdesc="Chart component"

  _install fakeinstall/usr/lib/gambas3/gb.chart.*
  _install fakeinstall/usr/share/gambas3/info/gb.chart.*
}

package_gambas3-gb-clipper() {
  depends=('gambas3-runtime')
  pkgdesc="Polygon clipping component"

  _install fakeinstall/usr/lib/gambas3/gb.clipper.*
  _install fakeinstall/usr/share/gambas3/info/gb.clipper.*
}

package_gambas3-gb-complex() {
  depends=('gambas3-runtime')
  pkgdesc="Complex numbers component"

  _install fakeinstall/usr/lib/gambas3/gb.complex.*
  _install fakeinstall/usr/share/gambas3/info/gb.complex.*
}

package_gambas3-gb-compress() {
  depends=('gambas3-runtime' 'bzip2' 'zlib' 'zstd')
  provides=('gambas3-gb-compress-bzlib2' 'gambas3-gb-compress-zlib' 'gambas3-gb-compress-zstd')
  pkgdesc="Compression support component"

  _install fakeinstall/usr/lib/gambas3/gb.compress.*
  _install fakeinstall/usr/share/gambas3/info/gb.compress.*
}

package_gambas3-gb-crypt() {
  depends=('gambas3-runtime' 'libxcrypt')
  pkgdesc="MD5/DES crypting component"

  _install fakeinstall/usr/lib/gambas3/gb.crypt.*
  _install fakeinstall/usr/share/gambas3/info/gb.crypt.*
}

package_gambas3-gb-data() {
  depends=('gambas3-runtime')
  pkgdesc="Data containers component"

  _install fakeinstall/usr/lib/gambas3/gb.data.*
  _install fakeinstall/usr/share/gambas3/info/gb.data.*
}

package_gambas3-gb-db-form() {
  depends=('gambas3-gb-db' 'gambas3-gb-form')
  pkgdesc="Database form component"

  _install fakeinstall/usr/lib/gambas3/gb.db.form.*
  _install fakeinstall/usr/share/gambas3/info/gb.db.form.*
  _install fakeinstall/usr/share/gambas3/control/gb.db.form/*
}

package_gambas3-gb-db-mysql() {
  depends=('gambas3-gb-db' 'mariadb-libs')
  pkgdesc="MySQL database access component"

  _install fakeinstall/usr/lib/gambas3/gb.db.mysql.*
  _install fakeinstall/usr/share/gambas3/info/gb.db.mysql.*
}

package_gambas3-gb-db-odbc() {
  depends=('gambas3-gb-db' 'unixodbc')
  pkgdesc="ODBC database access component"

  _install fakeinstall/usr/lib/gambas3/gb.db.odbc.*
  _install fakeinstall/usr/share/gambas3/info/gb.db.odbc.*
}

package_gambas3-gb-db-postgresql() {
  depends=('gambas3-gb-db' 'postgresql-libs')
  pkgdesc="PostgreSQL database access component"

  _install fakeinstall/usr/lib/gambas3/gb.db.postgresql.*
  _install fakeinstall/usr/share/gambas3/info/gb.db.postgresql.*
}

package_gambas3-gb-db-sqlite3() {
  depends=('gambas3-gb-db' 'sqlite' 'gcc-libs')
  pkgdesc="Sqlite3 database access component"

  _install fakeinstall/usr/lib/gambas3/gb.db.sqlite3.*
  _install fakeinstall/usr/share/gambas3/info/gb.db.sqlite3.*
}

package_gambas3-gb-db() {
  depends=('gambas3-runtime')
  pkgdesc="Database access component"

  _install fakeinstall/usr/lib/gambas3/gb.db.*
  _install fakeinstall/usr/share/gambas3/info/gb.db.*
}

package_gambas3-gb-dbus() {
  depends=('gambas3-gb-image' 'dbus')
  provides=('gambas3-gb-dbus-trayicon')
  pkgdesc="DBUS component"

  _install fakeinstall/usr/lib/gambas3/gb.dbus.*
  _install fakeinstall/usr/share/gambas3/info/gb.dbus.*
}

package_gambas3-gb-desktop-gnome() {
  depends=('libgnome-keyring')
  pkgdesc="Desktop component for Gnome"

  _install fakeinstall/usr/lib/gambas3/gb.desktop.gnome.*
  _install fakeinstall/usr/share/gambas3/info/gb.desktop.gnome.*
}

package_gambas3-gb-desktop-x11() {
  depends=('libsm' 'libxtst')
  pkgdesc="X-Window library support component"

  _install fakeinstall/usr/lib/gambas3/gb.desktop.x11.*
  _install fakeinstall/usr/share/gambas3/info/gb.desktop.x11.*
}

package_gambas3-gb-desktop() {
  depends=('perl' 'gambas3-gb-image')
  pkgdesc="Desktop component"

  _install fakeinstall/usr/lib/gambas3/gb.desktop.*
  _install fakeinstall/usr/share/gambas3/info/gb.desktop.*
  _install fakeinstall/usr/share/gambas3/control/gb.desktop/*
}

package_gambas3-gb-eval-highlight() {
  depends=('gambas3-runtime')
  pkgdesc="Expression evaluator highlight component"

  _install fakeinstall/usr/lib/gambas3/gb.eval.highlight.*
  _install fakeinstall/usr/share/gambas3/info/gb.eval.highlight.*
}

package_gambas3-gb-form-dialog() {
  depends=('gambas3-gb-form')
  pkgdesc="Form dialog component"

  _install fakeinstall/usr/lib/gambas3/gb.form.dialog.*
  _install fakeinstall/usr/share/gambas3/info/gb.form.dialog.*
}

package_gambas3-gb-form-mdi() {
  depends=('gambas3-gb-form')
  pkgdesc="Form MDI component"

  _install fakeinstall/usr/lib/gambas3/gb.form.mdi.*
  _install fakeinstall/usr/share/gambas3/info/gb.form.mdi.*
  _install fakeinstall/usr/share/gambas3/control/gb.form.mdi/*
}

package_gambas3-gb-form-stock() {
  depends=('gambas3-runtime')
  pkgdesc="Default stock icons component"

  _install fakeinstall/usr/lib/gambas3/gb.form.stock.*
  _install fakeinstall/usr/share/gambas3/info/gb.form.stock.*
}

package_gambas3-gb-form-editor() {
  depends=('gambas3-gb-eval-highlight')
  pkgdesc="Editor component"

  _install fakeinstall/usr/lib/gambas3/gb.form.editor.*
  _install fakeinstall/usr/share/gambas3/info/gb.form.editor.*
  _install fakeinstall/usr/share/gambas3/control/gb.form.editor/*
}

package_gambas3-gb-form-terminal() {
  depends=('perl' 'gambas3-runtime' 'gambas3-gui')
  pkgdesc="Terminal component"

  _install fakeinstall/usr/lib/gambas3/gb.form.terminal.*
  _install fakeinstall/usr/share/gambas3/info/gb.form.terminal.*
  _install fakeinstall/usr/share/gambas3/control/gb.form.terminal/*

}

package_gambas3-gb-form-htmlview() {
  depends=('gambas3-gb-form')
  pkgdesc="Htmlview component"

  _install fakeinstall/usr/lib/gambas3/gb.form.htmlview*
  _install fakeinstall/usr/share/gambas3/info/gb.form.htmlview*
  _install fakeinstall/usr/share/gambas3/control/gb.form.htmlview/*
}

package_gambas3-gb-form() {
  depends=('gambas3-runtime' 'gambas3-gui')
  pkgdesc="Form component"

  _install fakeinstall/usr/lib/gambas3/gb.form.*
  _install fakeinstall/usr/share/gambas3/info/gb.form.*
  _install fakeinstall/usr/share/gambas3/control/gb.form/*
}

package_gambas3-gb-gmp() {
  depends=('gambas3-runtime' 'gmp')
  pkgdesc="Arbitrary precision arithmetic component"

  _install fakeinstall/usr/lib/gambas3/gb.gmp.*
  _install fakeinstall/usr/share/gambas3/info/gb.gmp.*
}

package_gambas3-gb-gsl() {
  depends=('gambas3-runtime' 'gsl')
  pkgdesc="The GNU Scientific Library component"

  _install fakeinstall/usr/lib/gambas3/gb.gsl.*
  _install fakeinstall/usr/share/gambas3/info/gb.gsl.*
}

package_gambas3-gb-gtk3-opengl() {
  depends=('gambas3-gb-gtk3' 'gambas3-gb-opengl')
  pkgdesc="GTK3 toolkit OpenGL component"

  _install fakeinstall/usr/lib/gambas3/gb.gtk3.opengl.*
  _install fakeinstall/usr/share/gambas3/info/gb.gtk3.opengl.*
}

package_gambas3-gb-gtk3() {
  depends=('gambas3-gb-image' 'gtk3' 'webkit2gtk')
  pkgdesc="GTK3 toolkit component"
  provides=('gambas3-gui')

  _install fakeinstall/usr/lib/gambas3/gb.gtk3.*
  _install fakeinstall/usr/share/gambas3/info/gb.gtk3.*
}

package_gambas3-gb-hash() {
  depends=('gambas3-runtime')
  pkgdesc="Hashing functions"

  _install fakeinstall/usr/lib/gambas3/gb.hash.*
  _install fakeinstall/usr/share/gambas3/info/gb.hash.*
}

package_gambas3-gb-httpd() {
  depends=('gambas3-runtime' 'libxcrypt')
  pkgdesc="Embedded HTTP server for the interpreter"

  _install fakeinstall/usr/lib/gambas3/gb.httpd.*
  _install fakeinstall/usr/share/gambas3/info/gb.httpd.*
}

package_gambas3-gb-image-effect() {
  depends=('gambas3-gb-image' 'gcc-libs')
  pkgdesc="Image effect component"

  _install fakeinstall/usr/lib/gambas3/gb.image.effect.*
  _install fakeinstall/usr/share/gambas3/info/gb.image.effect.*
}

package_gambas3-gb-image-imlib() {
  depends=('gambas3-gb-image' 'imlib2')
  pkgdesc="Imlib component"

  _install fakeinstall/usr/lib/gambas3/gb.image.imlib.*
  _install fakeinstall/usr/share/gambas3/info/gb.image.imlib.*
}

package_gambas3-gb-image-io() {
  depends=('gambas3-gb-image' 'gdk-pixbuf2')
  pkgdesc="Input/Output image component"

  _install fakeinstall/usr/lib/gambas3/gb.image.io.*
  _install fakeinstall/usr/share/gambas3/info/gb.image.io.*
}

package_gambas3-gb-image() {
  depends=('gambas3-runtime')
  pkgdesc="Image component"

  _install fakeinstall/usr/lib/gambas3/gb.image.*
  _install fakeinstall/usr/share/gambas3/info/gb.image.*
}

package_gambas3-gb-inotify() {
  depends=('gambas3-runtime')
  pkgdesc="Filesystem events monitoring component"

  _install fakeinstall/usr/lib/gambas3/gb.inotify.*
  _install fakeinstall/usr/share/gambas3/info/gb.inotify.*
}

package_gambas3-gb-libxml() {
  depends=('gambas3-runtime' 'libxml2')
  pkgdesc="libxml2 component"

  _install fakeinstall/usr/lib/gambas3/gb.libxml.*
  _install fakeinstall/usr/share/gambas3/info/gb.libxml.*
}

package_gambas3-gb-logging() {
  depends=('gambas3-runtime')
  pkgdesc="Flexible log message handling component"

  _install fakeinstall/usr/lib/gambas3/gb.logging.*
  _install fakeinstall/usr/share/gambas3/info/gb.logging.*
}

package_gambas3-gb-map() {
  depends=('gambas3-gb-image-io' 'gambas3-gb-form')
  pkgdesc="Display maps component"

  _install fakeinstall/usr/lib/gambas3/gb.map.*
  _install fakeinstall/usr/share/gambas3/info/gb.map.*
  _install fakeinstall/usr/share/gambas3/control/gb.map/*
}

package_gambas3-gb-markdown() {
  depends=('gambas3-gb-image-io' 'gambas3-gb-form')
  pkgdesc="Convert the Gambas markdown syntax to HTML"

  _install fakeinstall/usr/lib/gambas3/gb.markdown.*
  _install fakeinstall/usr/share/gambas3/info/gb.markdown.*
}

package_gambas3-gb-media-form() {
  depends=('gambas3-runtime' 'gambas3-gb-media' 'gambas3-gui')
  pkgdesc="Media player control component"

  _install fakeinstall/usr/lib/gambas3/gb.media.form*
  _install fakeinstall/usr/share/gambas3/info/gb.media.form*
  _install fakeinstall/usr/share/gambas3/control/gb.media.form/*
}

package_gambas3-gb-media() {
  depends=('gambas3-runtime' 'gst-plugins-base-libs')
  pkgdesc="Simplified interface to the GStreamer library component"

  _install fakeinstall/usr/lib/gambas3/gb.media.*
  _install fakeinstall/usr/share/gambas3/info/gb.media.*
}

package_gambas3-gb-memcached() {
  depends=('gambas3-gb-net')
  pkgdesc="Memcached client component"

  _install fakeinstall/usr/lib/gambas3/gb.memcached.*
  _install fakeinstall/usr/share/gambas3/info/gb.memcached.*
}

package_gambas3-gb-mime() {
  depends=('gambas3-runtime' 'gmime3')
  pkgdesc="MIME message component"

  _install fakeinstall/usr/lib/gambas3/gb.mime.*
  _install fakeinstall/usr/share/gambas3/info/gb.mime.*
}

package_gambas3-gb-mysql() {
  depends=('gambas3-runtime' 'gambas3-gb-db-mysql')
  pkgdesc="Mysql extra component"

  _install fakeinstall/usr/lib/gambas3/gb.mysql.*
  _install fakeinstall/usr/share/gambas3/info/gb.mysql.*
}

package_gambas3-gb-ncurses() {
  depends=('gambas3-runtime' 'ncurses')
  pkgdesc="Ncurses component"

  _install fakeinstall/usr/lib/gambas3/gb.ncurses.*
  _install fakeinstall/usr/share/gambas3/info/gb.ncurses.*
}

package_gambas3-gb-net-curl() {
  depends=('gambas3-gb-net' 'curl')
  pkgdesc="Curl component"

  _install fakeinstall/usr/lib/gambas3/gb.net.curl.*
  _install fakeinstall/usr/share/gambas3/info/gb.net.curl.*
}

package_gambas3-gb-net-pop3() {
  depends=('gambas3-gb-net' 'gambas3-gb-mime')
  pkgdesc="POP3 component"

  _install fakeinstall/usr/lib/gambas3/gb.net.pop3.*
  _install fakeinstall/usr/share/gambas3/info/gb.net.pop3.*
  _install fakeinstall/usr/share/gambas3/control/gb.net.pop3/*
}

package_gambas3-gb-net-smtp() {
  depends=('gambas3-runtime' 'glib2')
  pkgdesc="SMTP component"

  _install fakeinstall/usr/lib/gambas3/gb.net.smtp.*
  _install fakeinstall/usr/share/gambas3/info/gb.net.smtp.*
  _install fakeinstall/usr/share/gambas3/control/gb.net.smtp/*
}

package_gambas3-gb-net() {
  depends=('gambas3-runtime')
  pkgdesc="Network component"

  _install fakeinstall/usr/lib/gambas3/gb.net.*
  _install fakeinstall/usr/share/gambas3/info/gb.net.*
}

package_gambas3-gb-openal() {
  depends=('gambas3-runtime' 'alure')
  pkgdesc="OpenAL 3D audio component"

  _install fakeinstall/usr/lib/gambas3/gb.openal.*
  _install fakeinstall/usr/share/gambas3/info/gb.openal.*
}

package_gambas3-gb-opengl-glu() {
  depends=('gambas3-gb-opengl')
  pkgdesc="GL Utility component"

  _install fakeinstall/usr/lib/gambas3/gb.opengl.glu.*
  _install fakeinstall/usr/share/gambas3/info/gb.opengl.glu.*
}

package_gambas3-gb-opengl-glsl() {
  depends=('gambas3-gb-opengl')
  pkgdesc="GLSL component"

  _install fakeinstall/usr/lib/gambas3/gb.opengl.glsl.*
  _install fakeinstall/usr/share/gambas3/info/gb.opengl.glsl.*
}

package_gambas3-gb-opengl-sge() {
  depends=('gambas3-gb-opengl')
  pkgdesc="Simple OpenGL game engine component"

  _install fakeinstall/usr/lib/gambas3/gb.opengl.sge*
  _install fakeinstall/usr/share/gambas3/info/gb.opengl.sge*
}

package_gambas3-gb-opengl() {
  depends=('gambas3-runtime' 'glew')
  pkgdesc="OpenGL component"

  _install fakeinstall/usr/lib/gambas3/gb.opengl.*
  _install fakeinstall/usr/share/gambas3/info/gb.opengl.*
}

package_gambas3-gb-openssl() {
  depends=('gambas3-runtime' 'openssl')
  pkgdesc="Openssl component"

  _install fakeinstall/usr/lib/gambas3/gb.openssl.*
  _install fakeinstall/usr/share/gambas3/info/gb.openssl.*
}

package_gambas3-gb-option() {
  depends=('gambas3-runtime')
  pkgdesc="Getopt component"

  _install fakeinstall/usr/lib/gambas3/gb.option.*
  _install fakeinstall/usr/share/gambas3/info/gb.option.*
}

package_gambas3-gb-pcre() {
  depends=('gambas3-runtime' 'pcre2')
  pkgdesc="PCRE component"

  _install fakeinstall/usr/lib/gambas3/gb.pcre.*
  _install fakeinstall/usr/share/gambas3/info/gb.pcre.*
}

package_gambas3-gb-poppler() {
  depends=('gambas3-runtime' 'poppler-glib')
  replaces=('gambas3-gb-pdf')
  pkgdesc="PDF component"

  _install fakeinstall/usr/lib/gambas3/gb.poppler.*
  _install fakeinstall/usr/share/gambas3/info/gb.poppler.*
}

package_gambas3-gb-qt5-opengl() {
  depends=('gambas3-gb-qt5' 'gambas3-gb-opengl')
  pkgdesc="Qt5 toolkit OpenGL component"

  _install fakeinstall/usr/lib/gambas3/gb.qt5.opengl.*
  _install fakeinstall/usr/share/gambas3/info/gb.qt5.opengl.*
}

package_gambas3-gb-qt5() {
  depends=('gambas3-gb-image' 'qt5-base' 'qt5-svg' 'qt5-webengine' 'qt5-x11extras')
  pkgdesc="Qt5 toolkit component"
  provides=('gambas3-gui')

  _install fakeinstall/usr/lib/gambas3/gb.qt5.*
  _install fakeinstall/usr/share/gambas3/info/gb.qt5.*
}

package_gambas3-gb-report() {
  depends=('gambas3-gb-form' 'gambas3-gb-image-io')
  pkgdesc="Report component"
  provides=("gambas3-gb-report2=${pkgver}")

  _install fakeinstall/usr/lib/gambas3/gb.report{,2}.*
  _install fakeinstall/usr/share/gambas3/info/gb.report{,2}.*
  _install fakeinstall/usr/share/gambas3/control/gb.report/*
  _install fakeinstall/usr/share/gambas3/control/gb.report2/*
}

package_gambas3-gb-scanner() {
  depends=('gambas3-gb-image' 'gambas3-gb-settings' 'sane')
  pkgdesc="Scanimage frontend component"

  _install fakeinstall/usr/lib/gambas3/gb.scanner.*
  _install fakeinstall/usr/share/gambas3/info/gb.scanner.*
}

package_gambas3-gb-sdl-sound() {
  depends=('gambas3-runtime' 'sdl_mixer')
  pkgdesc="SDL sound component"

  _install fakeinstall/usr/lib/gambas3/gb.sdl.sound.*
  _install fakeinstall/usr/share/gambas3/info/gb.sdl.sound.*
}

package_gambas3-gb-sdl() {
  depends=('gambas3-gb-image-io' 'sdl_ttf' 'libxcursor' 'glew')
  pkgdesc="SDL component"

  _install fakeinstall/usr/lib/gambas3/gb.sdl.*
  _install fakeinstall/usr/share/gambas3/info/gb.sdl.*
}

package_gambas3-gb-sdl2-audio() {
  depends=('gambas3-runtime' 'sdl2_mixer')
  pkgdesc="SDL2 audio component"

  _install fakeinstall/usr/lib/gambas3/gb.sdl2.audio.*
  _install fakeinstall/usr/share/gambas3/info/gb.sdl2.audio.*
}

package_gambas3-gb-sdl2() {
  depends=('gambas3-gb-image-io' 'sdl2_ttf' 'sdl2_image' 'glew')
  pkgdesc="SDL2 component"

  _install fakeinstall/usr/lib/gambas3/gb.sdl2.*
  _install fakeinstall/usr/share/gambas3/info/gb.sdl2.*
}

package_gambas3-gb-settings() {
  depends=('gambas3-runtime')
  pkgdesc="Setting component"

  _install fakeinstall/usr/lib/gambas3/gb.settings.*
  _install fakeinstall/usr/share/gambas3/info/gb.settings.*
}

package_gambas3-gb-signal() {
  depends=('gambas3-runtime')
  pkgdesc="POSIX Signals component"

  _install fakeinstall/usr/lib/gambas3/gb.signal.*
  _install fakeinstall/usr/share/gambas3/info/gb.signal.*
}

package_gambas3-gb-term() {
  depends=('gambas3-runtime')
  pkgdesc="Terminal management component"
  provides=("gambas3-gb-term-form=${pkgver}")

  _install fakeinstall/usr/lib/gambas3/gb.term.*
  _install fakeinstall/usr/share/gambas3/info/gb.term.*
}

package_gambas3-gb-util-web() {
  depends=('gambas3-runtime')
  pkgdesc="Miscellaneous web utility functions component"

  _install fakeinstall/usr/lib/gambas3/gb.util.web.*
  _install fakeinstall/usr/share/gambas3/info/gb.util.web.*
}

package_gambas3-gb-util() {
  depends=('gambas3-runtime')
  pkgdesc="Miscellaneous utility functions component"

  _install fakeinstall/usr/lib/gambas3/gb.util.*
  _install fakeinstall/usr/share/gambas3/info/gb.util.*
}

package_gambas3-gb-v4l() {
  depends=('gambas3-runtime' 'v4l-utils' 'libjpeg' 'libpng')
  pkgdesc="Video4linux component"

  _install fakeinstall/usr/lib/gambas3/gb.v4l.*
  _install fakeinstall/usr/share/gambas3/info/gb.v4l.*
}

package_gambas3-gb-vb() {
  depends=('gambas3-runtime')
  pkgdesc="Visual Basic transitional component"

  _install fakeinstall/usr/lib/gambas3/gb.vb.*
  _install fakeinstall/usr/share/gambas3/info/gb.vb.*
}

package_gambas3-gb-web-feed() {
  depends=('gambas3-gb-xml')
  pkgdesc="Web feed parser and generator component"

  _install fakeinstall/usr/lib/gambas3/gb.web.feed.*
  _install fakeinstall/usr/share/gambas3/info/gb.web.feed.*
}

package_gambas3-gb-web-form() {
  depends=('gambas3-gb-web' 'gambas3-gb-util-web')
  pkgdesc="web form component"

  _install fakeinstall/usr/lib/gambas3/gb.web.form.*
  _install fakeinstall/usr/share/gambas3/info/gb.web.form.*
}

package_gambas3-gb-web-gui() {
  depends=('gambas3-gb-web' 'gambas3-gb-util-web' 'gambas3-gb-util' 'gambas3-gb-signal')
  pkgdesc="web gui component"

  _install fakeinstall/usr/lib/gambas3/gb.web.gui.*
  _install fakeinstall/usr/share/gambas3/info/gb.web.gui.*
}

package_gambas3-gb-web() {
  depends=('gambas3-runtime')
  pkgdesc="CGI component"

  _install fakeinstall/usr/lib/gambas3/gb.web.*
  _install fakeinstall/usr/share/gambas3/info/gb.web.*
}

package_gambas3-gb-xml-html() {
  depends=('gambas3-gb-xml')
  pkgdesc="HTML generator component"

  _install fakeinstall/usr/lib/gambas3/gb.xml.html.*
  _install fakeinstall/usr/share/gambas3/info/gb.xml.html.*
}

package_gambas3-gb-xml-rpc() {
  depends=('gambas3-gb-xml' 'gambas3-gb-net-curl')
  pkgdesc="XML-RPC component"

  _install fakeinstall/usr/lib/gambas3/gb.xml.rpc.*
  _install fakeinstall/usr/share/gambas3/info/gb.xml.rpc.*
}

package_gambas3-gb-xml-xslt() {
  depends=('gambas3-gb-xml' 'libxslt')
  pkgdesc="XML-XSLT component"

  _install fakeinstall/usr/lib/gambas3/gb.xml.xslt.*
  _install fakeinstall/usr/share/gambas3/info/gb.xml.xslt.*
}

package_gambas3-gb-xml() {
  depends=('gambas3-runtime' 'gcc-libs')
  pkgdesc="XML component"

  _install fakeinstall/usr/lib/gambas3/gb.xml.*
  _install fakeinstall/usr/share/gambas3/info/gb.xml.*
}

package_gambas3-runtime() {
  depends=('libffi' 'xdg-utils')
  pkgdesc="Runtime environment"
  provides=('gambas3-gb-jit')

  _install fakeinstall/usr/bin/gb{r,x}3
  _install fakeinstall/usr/lib/gambas3/*
  _install fakeinstall/usr/share/gambas3/info/*
  _install fakeinstall/usr/share/man/man1/gb{r,x}3*

  install -dm755 ${pkgdir}/usr/share/gambas3/{mime,icons}

  install -m644 ${srcdir}/gambas-${pkgver}/main/mime/* ${pkgdir}/usr/share/gambas3/mime/
  install -m644 ${pkgdir}/usr/share/gambas3/mime/application-x-gambas3.png ${pkgdir}/usr/share/gambas3/icons/
}

package_gambas3-dev-tools() {
  depends=('gambas3-runtime')
  pkgdesc="Development environment"
  conflicts=('gambas3-devel')
  replaces=('gambas3-devel')

  _install fakeinstall/usr/bin/gb{a,c,i,h}3*
  _install fakeinstall/usr/share/man/man1/gb{a,c,i,h}3*
}

package_gambas3-ide() {
  depends=('gambas3-dev-tools' 'gambas3-gb-clipper' 'gambas3-gb-db-form' 'gambas3-gb-desktop' 'gambas3-gb-desktop-x11'
           'gambas3-gb-eval-highlight' 'gambas3-gb-form-dialog' 'gambas3-gb-form-editor' 'gambas3-gb-form-stock'
           'gambas3-gb-markdown' 'gambas3-gb-settings' 'gambas3-gb-form-mdi' 'gambas3-gb-image-effect' 'gambas3-gb-qt5'
           'gambas3-gb-net-curl' 'gambas3-gb-form-terminal' 'gambas3-gb-form-htmlview' 'gambas3-gb-signal'
           'gambas3-gb-term' 'gambas3-gb-pcre' 'gambas3-gb-util' 'gambas3-gb-util-web')
  pkgdesc="Integrated Development Environment"
  conflicts=('gambas3-examples')
  replaces=('gambas3-examples')

  _install fakeinstall/usr/bin/gambas3*
  _install fakeinstall/usr/share/appdata
  _install fakeinstall/usr/share/metainfo
  _install fakeinstall/usr/share/gambas3/template
  _install fakeinstall/usr/share/man/man1/gambas3.1

  install -dm755 ${pkgdir}/usr/share/applications
  install -dm755 ${pkgdir}/usr/share/pixmaps

  install -m644 ${srcdir}/gambas-${pkgver}/app/desktop/gambas3.desktop ${pkgdir}/usr/share/applications/
  install -m644 ${srcdir}/gambas-${pkgver}/app/desktop/gambas3.png ${pkgdir}/usr/share/pixmaps/
}

package_gambas3-script() {
  depends=('gambas3-dev-tools')
  pkgdesc="Scripter and server programs support"

  _install fakeinstall/usr/bin/gb{s,w}3*
  _install fakeinstall/usr/share/man/man1/gb{s,w}3*

  install -dm755 ${pkgdir}/usr/share/pixmaps
  install -dm755 ${pkgdir}/usr/share/mime/packages

  install -m644 ${srcdir}/gambas-${pkgver}/app/mime/*.png ${pkgdir}/usr/share/pixmaps
  install -m644 ${srcdir}/gambas-${pkgver}/app/mime/*.xml ${pkgdir}/usr/share/mime/packages
}
